import React from 'react';
import zhCN from 'antd/lib/locale/zh_CN';
import ReactDOM from 'react-dom';
import './index.less';
import HomeLogout from './pages';
import reportWebVitals from './reportWebVitals';
import {
    HashRouter as Router,
    Route, Switch
} from "react-router-dom";
import {persist, store} from "./redux/store";
import {Provider} from "react-redux";
import {PersistGate} from "redux-persist/integration/react";
import {ConfigProvider} from "antd";
import ApiLogin from "./pages/login";

ReactDOM.render(
    <Provider store={store}>
        <PersistGate loading={null} persistor={persist}>
            <ConfigProvider locale={zhCN}>
                <Router>
                    <Switch>
                        <Route path='/login' render={routeProps => <ApiLogin {...routeProps} />}/>
                        <Route path='/home' render={routeProps => <HomeLogout {...routeProps} />} />
                    </Switch>
                </Router>
            </ConfigProvider>
        </PersistGate>
    </Provider>,
    document.getElementById('root')
);
reportWebVitals();
